<!-- /* Description for file.
 * 收费明细
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/users
 * @since         ues
 * @version       V0.0.1
 * @modifiedby    张海杰2011年0628
 * @lastmodified  张海杰2011年0721
 */
 -->
 
<?php
echo $html->css('flexigrid');
echo $html->css('start/jquery-ui-1.8.2.custom');
echo $javascript->link('jquery-1.4.2');
echo $javascript->link('feebillajax');
echo $javascript->link('flexigrid/flexigrid'); 
echo $javascript->link('jquery-ui-1.8.2.custom.min');

?>

<script type="text/javascript">
	$(function(){
		$(".datepickerSpan :input").datepicker({
			inline: true
		});
		 $('.datepickerSpan :input').datepicker('option', {dateFormat: "yy-mm-dd"});
		 $('.datepickerSpan :input').datepicker( "option", "closeText", 'X' );
		 $("#payTime").val("<?php echo $feebills[0]['Feeitem']['payTime'];?>");
	});
</script>

<div class="message" style="display:none"></div>
<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Feelists  Select Management');//一级目录
										   echo '>';echo __('Feelists  Select');//一级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('费用条目修改',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->

<!--                                          按钮区域-->
<script type="text/javascript">
$(function(){
		$("#bt_0").click(function () {$(".bt0").click();});
		$("#bt_2").click(function () {$(".bt2").click();});
		$("#bt_4").click(function () {$(".bt4").click();});
		});
</script>
<div class="buttonbg">
<a style="width:24px;" id="bt_0">添加</a>   <!-- 一个中文字12px宽 a的宽根据按钮内容设 -->
<a style="width:24px;" id="bt_2">删除</a>
<a style="width:24px;" id="bt_4">更新</a>
</div>
<!--                                         按钮区域--> 

<?php echo $form->create('Feeitem',array('action'=>'edit','type'=> 'post'));?>
<?php echo $form->hidden('id',array('default'=>$id,'id'=>'id'));?>
<div class="tabflex">
<fieldset><legend><?php __('费用条目修改');?></legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
	<td width="100"></td>
	<td width="70">顾&nbsp;&nbsp;&nbsp;&nbsp;问:</td>
	<td width="300"><?php echo $form->input('Feeitem.adviser',array('default' =>$feebills[0]['Feeitem']['adviser'],'class' => 'TextBoxE3','div'=>false,'label'=>false,'disabled'=>true));?></td>
	<td ></td>
	<td width="50"></td>
	<td width="100">&nbsp;&nbsp;&nbsp;&nbsp;条目状态:</td>
	<td width="300"><?php echo $form->input('listStatue',array('options'=>$op,'default' =>$feebills[0]['Feeitem']['listStatue'],'class' => 'TextBoxE3','div'=>false,'label'=>false));?></td>
	<td></td>
	</tr>
	<tr>
	<td width="100"></td>
	<td width="70">收款笔数:</td>
	<td width="300"><?php echo $form->input('Feeitem.payPattern',array('default' =>$feebills[0]['Feeitem']['payPattern'],'class' => 'TextBoxE3','div'=>false,'label'=>false,'disabled'=>true));?></td>
	<td ></td>
	<td width="50"></td>
	<td width="100">&nbsp;&nbsp;&nbsp;&nbsp;收费金额:</td>
	<td width="300"><?php echo $form->input('feeAmount',array('default' =>$feebills[0]['Feeitem']['feeAmount'],'class' => 'TextBoxE3','div'=>false,'label'=>false,'disabled'=>true));?></td>
	<td></td>
	</tr>
	<tr>
	<td width="100"></td>
	<td width="70">客户名称:</td>
	<td width="300"><?php echo $form->input('Feeitem.companyName',array('default' =>$company,'class' => 'TextBoxE3','div'=>false,'label'=>false,'disabled'=>true));?></td>
	<td ></td>
	<td width="50"></td>
	<td width="100">约定付款时间:</td>
	<td width="300">
	<span class="datepickerSpan">
		<?php 
			echo $form->input('payTime',array('default'=>$feebills[0]['Feeitem']['payTime'],'label'=>false,'id'=>'payTime','class' => 'TextBoxE3'));
		?>
	</span>
	</td>
	<td></td>
	</tr>
	<tr>
	<td width="100"></td>
	<td width="70" style="vertical-align:top;">条目说明:</td>
	<td  colspan="6"><?php echo $form->textarea('Feeitem.explain',array('default' =>$feebills[0]['Feeitem']['explain'],'class' => 'TextArea1 txtOut','div'=>false,'label'=>false));?></td>
	</tr>
</table>
</fieldset>

	<table width="100%" cellspacing="0" cellpadding="0" border="0" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php echo $form->button('确定',array('type'=>'submit','class'=>'oksubmit','onclick'=>'mycheck()'));?>  <!-- __('reset', true)取消-->
		<td width="100"><?php echo $form->button('重置',array('type'=>'reset','class'=>'resetsubmit'));?>  <!-- __('reset', true)取消-->
		</td>
	</tr>
</table>

</div>
<?php echo $form->end();?>

<script language="javascript">
var delurl="<?php echo $deleteurl; ?>";
</script>
<script language="javascript">
var editurl="<?php echo $editurl; ?>";
</script>
<script language="javascript">
var addurl="<?php echo $addurl; ?>";
</script>
<script language="javascript">
var data=<?php echo $data; ?>;
</script>
<script language="javascript">
var disbutton=<?php echo $javascript->object($disbutton);?>;
</script>
<script language="javascript">
var title2="<?php echo $title2; ?>";
</script>

<script language="javascript">
function button(com,grid,url)  
{  
	var ids=$("#flex").getCheckedRows();
	if(com=="delete")
	{
		var pids="";
		if(ids.length==0)
		{
			alert("请选择你要删除的项");
			return;
		}
		if(!confirm("确定删除?"))
		{
			return;
		}
		for(i=0;i<ids.length;i++)
        {
        	pids=pids+ids[i]+"/";
        }

		$.ajax({
            type: "post",
            url: url,
            data: {id:pids},
            dataType:"json",
            success: function(data) {
            	
			},
            error: function(data) {
				$(".clearckeck").trigger("click");
				$(".pReload").trigger("click");
				$(".notice").html('data.message');
			}
        });
		window.location.reload(); 
	}
	else if(com=="add")
	{
		window.open(url);
	}
	else if(com=="edit")
	{
		if(ids.length!=1)
		{
			alert("请选择一个选项");
		}
		else
		{
			var seid=ids[0];
			var eurl=url+"?id="+seid;
			window.open(eurl);
		}
	}
}
</script>
<script type="text/javascript">
var b=[{
	name:'add',
	displayname : '添加',
	tp : '<?php echo ROOT_WEB_PATH; ?>/app/webroot/css/images/icons/add.png',
	bclass : 'add',
	onpress : button,
	display:disbutton.add,
	url:addurl
},
{
	// 设置分割线
	separator : true,
	display:disbutton.del
},
{
	name:'delete',
	displayname : '删除',
	tp : '<?php echo ROOT_WEB_PATH; ?>/app/webroot/css/images/icons/delete.png',
	bclass : 'delete',
	onpress : button,
	display:disbutton.del,
	url:delurl
},
{
	// 设置分割线
	separator : true,
	display:disbutton.del
},
{
	name:'edit',
	displayname : '更新',
	tp : '<?php echo ROOT_WEB_PATH; ?>/app/webroot/css/images/icons/edit.png',
	bclass : 'add',
	onpress : button,
	display:disbutton.edit,
	url:editurl
},
{
	// 设置分割线
	separator : true,
	display:disbutton.edit
}];
</script>
<script type="text/javascript">
var ob=<?php echo $ob;?>;
if(ob.length==0)
{
	
}
else
{
	for(i=0;i<ob.length;i++)
	{
		var l=b.length;
		b[l]=ob[i];
	}
}
</script>
<div class="tabflex">
<table id="flex" style="display: none"></table><br></br>
</div>
